package com.matt.foundation.constant;

import lombok.Setter;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/9/7
 * *******************************
 */
public class ChildrenCourseConstant {
    public enum Status{
        NORMAL(0, "正常"),
        END(1, "已结束");

        @Setter
        private int code;

        @Setter
        private String value;

        Status(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public Status get(int code){
            for (Status status : values()) {
                if (status.codeOf()==code)
                    return status;
            }
            return null;
        }
    }


    public enum ItemStatus{
        NON_USED(1, "未上"),
        USED(2, "已上"),
        SKIP(3, "旷课"),
        LEAVE(4, "请假"),
        EVALUATED(5, "已评测"),
        ;

        @Setter
        private int code;

        @Setter
        private String value;

        ItemStatus(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public ItemStatus get(int code){
            for (ItemStatus status : values()) {
                if (status.codeOf()==code)
                    return status;
            }
            return null;
        }
    }
}
